import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 属性表分页查询
 * @param {查询条件} data
 */
export function listLayAttr(query) {
  return request({
    url: 'business/LayAttr/list',
    method: 'get',
    params: query,
  })
}

/**
 * 属性表tree查询
 * @param {查询条件} data
 */
export function treelistLayAttr(query) {
  return request({
    url: 'business/LayAttr/treelist',
    method: 'get',
    params: query,
  })
}
/**
 * 新增属性表
 * @param data
 */
export function addLayAttr(data) {
  return request({
    url: 'business/LayAttr',
    method: 'post',
    data: data,
  })
}
/**
 * 修改属性表
 * @param data
 */
export function updateLayAttr(data) {
  return request({
    url: 'business/LayAttr',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取属性表详情
 * @param {Id}
 */
export function getLayAttr(id) {
  return request({
    url: 'business/LayAttr/' + id,
    method: 'get'
  })
}

/**
 * 删除属性表
 * @param {主键} pid
 */
export function delLayAttr(pid) {
  return request({
    url: 'business/LayAttr/delete/' + pid,
    method: 'POST'
  })
}
// 导出属性表
export async function exportLayAttr(query) {
  await downFile('business/LayAttr/export', { ...query })
}
